/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author zcc
* @date 2021-07-18
**/
@Entity
@Data
@Table(name="fz_events")
public class FzEvents implements Serializable {

    @Id
    @Column(name = "id")
    @ApiModelProperty(value = "id")
    private String id;

    @Column(name = "sort")
    @ApiModelProperty(value = "排序")
    private Integer sort;

    @Column(name = "date_time")
    @ApiModelProperty(value = "日期")
    private Timestamp dateTime;

    @Column(name = "subject_name")
    @ApiModelProperty(value = "事项")
    private String subjectName;

    @Column(name = "content")
    @ApiModelProperty(value = "事件")
    private String content;

    @Column(name = "person")
    @ApiModelProperty(value = "相关人员")
    private String person;

    @Column(name = "money")
    @ApiModelProperty(value = "价格")
    private Double money;

    @Column(name = "remark")
    @ApiModelProperty(value = "备注")
    private String remark;

    @Column(name = "sub_type")
    @ApiModelProperty(value = "收支类型")
    private String subType;

    public void copy(FzEvents source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}